import Request from '@/utils/requset.js'
let request = new Request().http

function removeStr(obj) {
  if(obj) {
    let removePropertyOfNull=function(obj){
      Object.keys(obj).forEach(item=>{
        if(!obj[item])  delete obj[item]
      })
      return obj;
    }
    removePropertyOfNull(obj)
  }
  return obj?obj:''
}

// show列表查询(买家秀)
const getBuyerShowList = (params) => {
	return request({
	    url: "/nailShow/queryList",
	    method: "GET",
	    params: removeStr(params),
	})
}

// show列表查询(买家秀)顶部排名
const getQuerySubjectRank = (params) => {
	return request({
	    url: "/nailShow/querySubjectRank",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 查看某个show
const getShowDetail = (params) => {
	return request({
	    url: "/nailShow/queryById",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 根据ID查询show对应订单的元素图
const getQueryElementByShowId = (params) => {
	return request({
	    url: "/nailShow/queryElementByShowId",
	    method: "GET",
	    params: removeStr(params),
	})
}

// show列表查询(我的美甲秀)
const getQueryMyShow = (params) => {
	return request({
	    url: "/nailShow/queryMyShow",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 默认的甲片商品
const getQueryGoodsInfo = (params) => {
	return request({
	    url: "/nailGoodsInfo/queryGoodsInfo",
	    method: "GET",
	    params: removeStr(params),
	})
}

// 素材图片
const getQuerySubjectGoodsList = (params) => {
	return request({
	    url: "/nailSubject/querySubjectGoodsList",
	    method: "GET",
	    params: removeStr(params),
	})
}


export {
	getBuyerShowList,
	getQuerySubjectRank,
	getShowDetail,
	getQueryElementByShowId,
	getQueryMyShow,
	getQueryGoodsInfo,
	getQuerySubjectGoodsList
}